module.exports = app => {
  return async (ctx, next) => {
      ctx.socket.emit('res', {user:'1222'});
      console.log('im in'+ctx.state.user)
      await next();
      // execute when disconnect.
      console.log('disconnection!');
  };
};